googologywikiaorg-20200223-history
User blog:Rgetar/New program (ordinals up to Rathjen ordinal)
I modified my program I published in my previous blog post and created its new version Ordinal Explorer v3.0. I think that its countable limit is ordinal #1201 of Scorcher007's list of ordinals ('Rathjen ordinal'). (Countable limit in v2.0 was #691 or 'Small Rathjen ordinal'). Alphabet The notation uses 3 symbols: :[ :] :M (In v2.0 was "I" instead of "M"). Strings There are 3 kinds of strings: :' :M :Xα, where X and α are strings (Some examples of correspondence "string - ordinal": empty string is 0; "M" is least weakly Mahlo cardinal; "[]" is 1; "[[]]" is ω (least infinite ordinal), see Fundamental sequence algorythm section). Base For string Xα base is α: :base(Xα) = α For empty string and M base is empty string: :base() = :base(M) = Booster For string Xα booster is X: :booster(Xα) = X For empty string and M booster is empty string: :booster() = :booster(M) = Countable limit Countable limit of this notation ('Rathjen ordinal') is designated as "L". Comparison Note: this comparison algorythm is the same as in v2.0, but with "M" instead of "I". Note: this comparison algorythm works only with standard forms (for non-standard form it would work improperly). Definition of standard form see in Standard forms section. Comparison of two strings s1 and s2: If strings are the same then :strings are equal else if one of strings is empty string then :empty string is lesser else if rightmost symbol of one and only one string is "M" then :string with rightmost symbol "M" is larger else if rightmost symbol of both strings is "M" then :delete rightmost symbol ("M") from s1 and s2 and compare them (result of comparison of s1 and s2 is result of this comparison) else if strings between rightmost "]" and corresponding "of s1 and s2 are not the same then :compare strings between rightmost "" and corresponding "of s1 and s2 (result of comparison of s1 and s2 is result of this comparison) else :delete all from rightmost "" to corresponding "[" from s1 and s2 and compare them (result of comparison of s1 and s2 is result of this comparison). Cofinality Differences with v2.0 are '''bolded. (I determine cofinality of 0 as 0, and cofinality of a successor as 1). Note: there are 8 cases for cofinality and fundamental sequence algorythms, and these cases are designated with numbers. Let :β = base(α) :X = booster(α) Cofinality of α (cof(α)): If α is empty string or M''' then (Cases 1, 2) :cof(α) = α else if X is empty string then (Case 3) :cof(α) = [] else if 'cof('X)' = '''M' > β then (Case 4) :cof(α) = α else if [] < cof(X) < α then (Case 6) :cof(α) = cof(X) else (Cases 5, 7, 8) :cof(α) = [[]] Fundamental sequence algorythm Differences with v2.0 are bolded. (I determine that 0 has no fundamental sequence, and fundamental sequence of a successor α + 1 has only one (0-th) element α). Note: there are 8 cases for cofinality and fundamental sequence algorythms, and these cases are designated with numbers. Let :β = base(α) :X = booster(α) :γ = base(X) :δ = base(cof(X)) :Y = booster(cof(X)) n-th element of fundamental sequence of α (αn): If α = L then (Case of L) :αn = Zn, where Z0 = M', Zn + 1 = Zn'M else if α is empty string then (Case 1) :α has no fundamental sequence else if α = M''' then (Case 2) :αn = n else if X is empty string then (Case 3) :αn = β else if 'cof('X)' = '''M' > β then (Case 4) :αn = n else if cof(X) = [] then (Case 5) :α0 = β, α+ 1 = γαn (γ and αn, not n-th fs element of γα) else if cof(X) < α then (Case 6) :αn = [Xn]β else if Y = M and δ ≤ α then (Case 7) :α0 = β, α+ 1 = [X[αn]]β else (Case 8) :α0 = β, α[n + 1] = [X['''Zn]]β, where Z0 = '''δ, Zn + 1 = [YZn]δ March 30, 2019 edit: initially in this blog for Case 8 was "α+ 1 = Znβ" instead of "α+ 1 = [XZn]β", because after I wrote the program I wrote these rules on a sheet of paper with this error, then I wrote this blog with the same error. Now I fixed it. The program itself did not contain this error. Standard forms "L" is a standard form; any generated by this algorythm element of fundamental sequence of a standard form is a standard form; base and booster of a standard form are standard forms. Decryption of strings Here are some rules how to decrypt strings (these rules are not suitable for arbitrary strings - for arbitrary strings use fundamental sequence algorythm). Empty string is 0, M is least weakly Mahlo cardinal. For α = Xβ: If least uncountable cardinal larger than X ≤ least uncountable cardinal larger than β then :Xβ = β + ωX else :Mβ is least uncountable cardinal larger than β :M2β is least weakly inaccessible cardinal larger than β :M3β is least weakly 1-inaccessible cardinal larger than β :M4β is least weakly 2-inaccessible cardinal larger than β :M5β is least weakly 3-inaccessible cardinal larger than β :... :M2β is least weakly hyperinaccessible cardinal larger than β :... :(for other cases see fundamental sequence algorythm) + 1β is limit of :β :Xβ :XXβ :XXXβ :XXXXβ :XXXXXβ :... Examples: :[]β = β + 1 :[][]β = β + 2 :[][][]β = β + 3 :[][][][][]β = β + 4 :[][][][][][]β = β + 5 :[[]]β = 1β = β + ω :[]β = ωβ = β + ωω :M = Ω :[]M = Ω + 1 :MM = MΩ = Ω2 :[]MM = []Ω2 = Ω2 + 1 :MMM = ΩΩ2 = Ω2 + Ω :MMM = MΩ2 = Ω3 :[]M = M + 1 :[[]M] = + 1 = MMMMM... = Ωω :M[[]M] = M+ 1 = Ωω + 1 :MM = ΩΩ = Ω2 :MMM = ΩΩΩ = Ω3 :[MM]M = Ω2Ω = ωΩ2 = Ω2 :[[MM]M]M = Ω2Ω = ωΩ2 = ΩΩ :[[[MM]M]M]M = ΩΩΩ = ωΩΩ = ΩΩΩ :MM = M2 :[MM] = M2 = I :M[MM] = MI = ΩI + 1 :MMM = M3 :[MMM] = M3 = least weakly 1-inaccessible cardinal :[MM]M = M2M = ωM2 = M2 :[[MM]M] = M2 = least weakly hyperinaccessible cardinal :[[MM]M]M = M2M = ωM2 = MM :[[[MM]M]M]M = MMM = ωMM = MMM Lists of ordinals I decided to post lists of ordinals in a separate blog, since they are too large. Source code Source code of Ordinal Explorer v3.0. For comparison see function compare, for cofinality see function cof, for fundamental sequence algorythm see function fs. In function cof and function fs 8 cases are designated with numbers. unit Ord; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, StrUtils, Math, ScktComp; type TForm1 = class(TForm) Button1: TButton; Label1: TLabel; Label2: TLabel; Label3: TLabel; ServerSocket1: TServerSocket; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; procedure Button1Click(Sender: TObject); procedure Serversocket1ClientRead(Sender: TObject; Socket: TCustomWinSocket); procedure Form1Create(Sender: TObject); procedure Form1Destroy(Sender: TObject); end; lis=array of record s{,i}: string; c,l: integer; end; rar=array0..19 of string; var Form1: TForm1; st,st1,bo,cout,qhost,fa,col: string; s: lis; f: textfile; b,bn,g: boolean; cn,cl,sl,br: integer; duq,uq,bro,brc: rar; implementation {$R *.dfm} // get position of last symbol p of string st (if l=true then first) function getls(st,p:string; l:boolean=false):integer; var e,np: integer; begin if length(st)=0 then result:=ifthen(l,1,0) else begin if l then e:=0 else e:=length(st)+1; np:=0; repeat if l then inc(e) else dec(e); if ste='then dec(np); if st[e=']' then inc(np); until (not l and (e=1)) or (l and (e=length(st))) or ((ste=p) and (np=0)); if not l and (e=1) and (st1<>p) then e:=0 else if l and (e=length(st)) and (ste<>p) then e:=length(st)+1; result:=e; end; end; // get base of string st (in new notation) function base(st:string):string; begin result:=copy(st,getls(st,']',true)+1,length(st)); end; // get booster of string st (in new notation) function booster(st:string):string; begin result:=copy(st,2,getls(st,']',true)-2); end; // get successor of ordinal st function suc(st:string):string; begin result:='[]'+st; end; // get X from successor ordinal st = X + 1 function pred(st:string):string; begin result:=copy(st,3,length(st)); end; // finite ordinal string st to number function fostn(st:string):integer; begin if st='' then result:=0 else result:=(length(st)+1) div 2; end; // finite ordinal e from integer to computer format function cf(e:integer):string; begin result:=''; while e>0 do begin dec(e); result:=suc(result); end; end; // compare standard forms of ordinals st1, st2 (if st1st2 then 1) function compare(st1,st2:string):shortint; var q1,q2,l1,l2:integer; begin if st1=st2 then result:=0 else if st1='' then result:=-1 else if st2='' then result:=1 else if (rightstr(st1,1)=col) and (rightstr(st2,1)<>col) then result:=1 else if (rightstr(st2,1)=col) and (rightstr(st1,1)<>col) then result:=-1 else if rightstr(st1,1)=col then result:=compare(leftstr(st1,length(st1)-1),leftstr(st2,length(st2)-1)) else repeat l1:=length(st1); l2:=length(st2); q1:=getls(st1,'q2:=getls(st2,'['); delete(st1,l1,1); delete(st2,l2,1); result:=compare(copy(st1,q1+1,l1),copy(st2,q2+1,l2)); if result=0 then begin delete(st1,q1,l1); delete(st2,q2,l2); if st1='' then result:=-1 else if st2='' then result:=1; end; until result<>0; end; // get cofinality of ordinal st function cof(st:string):string; var c:string; begin if (st='') or (st=col) then // 1, 2 result:=st else begin c:=cof(booster(st)); if c='' then // 3 result:='[' else if (c=col) and (compare(col,st)=1) then // 4 result:=st else if (compare(c,'[]')=1) and (compare(st,c)=1) then // 6 result:=c else // 5, 7, 8 result:='[[]]'; end; end; // get n-th element of fs of ordinal st function fs(st,n:string):string; var c,s,x,y,z:string; i:integer; begin if st='L' then // L begin z:=col; for i:=1 to fostn(n) do z:=''+z+''+col; result:=brobr+2+z+brcbr+2; end else if st=col then // 2 result:=n else begin x:=booster(st); c:=base(st); if x='' then // 3 result:=c else begin s:=cof(x); if (s=col) and (compare(col,c)=1) then // 4 result:=n else if s='[]' then // 5 begin x:=pred(x); for i:=1 to fostn(n) do c:=''+x+''+c; result:=c; end else if compare(st,s)=1 then // 6 result:=''+fs(x,n)+''+c else begin y:=booster(s); z:=base(s); if (y=col) and (compare(z,st)<1) then // 7 begin s:=c; for i:=1 to fostn(n) do s:=''+fs(x,s)+''+c; result:=s; end else begin // 8 if n='' then result:=c else begin s:=z; for i:=2 to fostn(n) do s:=''+fs(y,s)+''+z; result:=''+fs(x,s)+''+c; end; end; end; end; end; end; function convert(st:string;z:boolean=false):string; begin result:=st; end; // small expansion of pair c > l function se(c,l:string; yn:integer; var n:string):string; var u:integer; begin n:=''; repeat result:=fs(c,n); n:=suc(n); until (l='-') or (compare(result,l)=1); for u:=3 to yn do n:=suc(n); if yn>1 then result:=fs(c,n); end; // levelup (q - number of levelups, yn - number of fs elements, inserted in last levelup) procedure levelup(q:integer; yn:integer=0); var e,i,y,u,j: integer; n,l,p,a,c: string; begin inc(yn); while q>0 do begin dec(q); if q>0 then j:=1 else j:=yn; e:=0; c:=se.s; i:=se.c; y:=0; form1.Label2.Caption:=inttostr(cn)+' '; form1.Label2.Refresh; repeat begin n:=''; if i=-1 then begin l:='-'; p:=''; end else begin l:=si.s; p:=suc(l); end; if compare(c,p)=0 then begin e:=i; if e>-1 then begin c:=se.s; i:=se.c; if i=-1 then e:=i; end; dec(cn); form1.Label2.Caption:=inttostr(cn)+' '; form1.Label2.Refresh; end else begin a:=se(c,l,j,n); u:=0; while ulength(s) then setlength(s,length(s)*2); form1.Label1.Caption:=inttostr(sl); form1.Label1.Refresh; e:=y; se.c:=i; se.s:=a; se.l:=ifthen(u=j,cl,cl+1); if u<>j then begin n:=pred(n); a:=fs(c,n); end; end; c:=a; end; end; until e=-1; cn:=y; inc(cl); end; end; function ruq(st:string;uq:rar):rar; var e,i:integer; begin st:=st+'='; result:=uq; while (st<>'=') and (st<>'') do begin e:=system.ord(st1)-48; delete(st,1,1); i:=pos('=',st); resulte:=leftstr(st,i-1); delete(st,1,i); end; end; function wuq(st:string):string; var e:integer; huq:rar; begin huq:=ruq(st,uq); result:=''; for e:=0 to length(uq)-1 do if huqe<>duqe then begin if result<>'' then result:=result+'='; result:=result+chr(e+48)+huqe; end; end; // get html link s, displaying string st function getrefs(s, st: string):string; begin result:=''+st+''; end; procedure ads(st:string); begin if g then cout:=cout+st else writeln(f,st); end; procedure starthtml; begin cout:=''; st:=' '; st:='sup {font-size: 0.83rem;}'+st; st:='sub {font-size: 0.83rem;}'+st; st:='